package com.ruoyi.check.domain;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Date;
import lombok.Data;

/**
 * #商品规格信息表
 * @TableName bm_specification
 */
@Data
public class BmSpecification implements Serializable {
    /**
     * 规格id
     */
    private Long id;

    /**
     * 所属商品id
     */
    private Long goodsId;

    private String goodsName;

    private String warehouseCode;
    private String mark;

    /**
     * 规格名称
     */
    private String specificationName;

    /**
     * 原价
     */
    private BigDecimal oldPrice;

    /**
     * 现价
     */
    private BigDecimal price;

    /**
     * 库存
     */
    private Integer stock;

    private Integer goodId;

    /**
     * 警戒库存
     */
    private Integer warnStock;

    /**
     * 总销量
     */
    private Integer allSaled;

    /**
     * 月销量
     */
    private String currentMonth;

    /**
     * 是否上架 0.未上架 1.上架
     */
    private Integer isShelves;

    /**
     * 是否推荐 0.不推荐 1.推荐
     */
    private Integer isRecommond;

    /**
     * 商品图片
     */
    private String goodsImgUrl;

    /**
     * 保质期
     */
    private String qualityPeriod;

    /**
     * 生产日期
     */
    private Date productionDate;

    /**
     * 二维码
     */
    private byte[] barCode;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        BmSpecification other = (BmSpecification) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getGoodsId() == null ? other.getGoodsId() == null : this.getGoodsId().equals(other.getGoodsId()))
            && (this.getSpecificationName() == null ? other.getSpecificationName() == null : this.getSpecificationName().equals(other.getSpecificationName()))
            && (this.getOldPrice() == null ? other.getOldPrice() == null : this.getOldPrice().equals(other.getOldPrice()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getStock() == null ? other.getStock() == null : this.getStock().equals(other.getStock()))
            && (this.getWarnStock() == null ? other.getWarnStock() == null : this.getWarnStock().equals(other.getWarnStock()))
            && (this.getAllSaled() == null ? other.getAllSaled() == null : this.getAllSaled().equals(other.getAllSaled()))
            && (this.getCurrentMonth() == null ? other.getCurrentMonth() == null : this.getCurrentMonth().equals(other.getCurrentMonth()))
            && (this.getIsShelves() == null ? other.getIsShelves() == null : this.getIsShelves().equals(other.getIsShelves()))
            && (this.getIsRecommond() == null ? other.getIsRecommond() == null : this.getIsRecommond().equals(other.getIsRecommond()))
            && (this.getGoodsImgUrl() == null ? other.getGoodsImgUrl() == null : this.getGoodsImgUrl().equals(other.getGoodsImgUrl()))
            && (this.getQualityPeriod() == null ? other.getQualityPeriod() == null : this.getQualityPeriod().equals(other.getQualityPeriod()))
            && (this.getProductionDate() == null ? other.getProductionDate() == null : this.getProductionDate().equals(other.getProductionDate()))
            && (Arrays.equals(this.getBarCode(), other.getBarCode()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getGoodsId() == null) ? 0 : getGoodsId().hashCode());
        result = prime * result + ((getSpecificationName() == null) ? 0 : getSpecificationName().hashCode());
        result = prime * result + ((getOldPrice() == null) ? 0 : getOldPrice().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getStock() == null) ? 0 : getStock().hashCode());
        result = prime * result + ((getWarnStock() == null) ? 0 : getWarnStock().hashCode());
        result = prime * result + ((getAllSaled() == null) ? 0 : getAllSaled().hashCode());
        result = prime * result + ((getCurrentMonth() == null) ? 0 : getCurrentMonth().hashCode());
        result = prime * result + ((getIsShelves() == null) ? 0 : getIsShelves().hashCode());
        result = prime * result + ((getIsRecommond() == null) ? 0 : getIsRecommond().hashCode());
        result = prime * result + ((getGoodsImgUrl() == null) ? 0 : getGoodsImgUrl().hashCode());
        result = prime * result + ((getQualityPeriod() == null) ? 0 : getQualityPeriod().hashCode());
        result = prime * result + ((getProductionDate() == null) ? 0 : getProductionDate().hashCode());
        result = prime * result + (Arrays.hashCode(getBarCode()));
        return result;
    }


    @Override
    public String toString() {
        return "BmSpecification{" +
                "id=" + id +
                ", goodsId=" + goodsId +
                ", goodsName='" + goodsName + '\'' +
                ", warehouseCode='" + warehouseCode + '\'' +
                ", mark='" + mark + '\'' +
                ", specificationName='" + specificationName + '\'' +
                ", oldPrice=" + oldPrice +
                ", price=" + price +
                ", stock=" + stock +
                ", warnStock=" + warnStock +
                ", allSaled=" + allSaled +
                ", currentMonth='" + currentMonth + '\'' +
                ", isShelves=" + isShelves +
                ", isRecommond=" + isRecommond +
                ", goodsImgUrl='" + goodsImgUrl + '\'' +
                ", qualityPeriod='" + qualityPeriod + '\'' +
                ", productionDate=" + productionDate +
                ", barCode=" + Arrays.toString(barCode) +
                '}';
    }
}